package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.applet.dto.PayOrderDto;
import com.shensi.api.admin.domian.station.dto.PayOrderDetailQueryForm;
import com.shensi.api.admin.domian.station.dto.PayOrderEmployeeQueryForm;
import com.shensi.api.admin.domian.station.dto.SysAppUserInfoDto;
import com.shensi.api.admin.domian.station.vo.InvoiceInfoVo;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface PayOrderClient {

    //小票补打
    @GetMapping("/station/order/feiePush")
    public AjaxResult feiePush(@SpringQueryMap PayOrderDto payOrder1);


    /**
     * 查询订单支付列表
     * 这个方法在前端展示为退款列表
     */
    @GetMapping("/station/order/list")
    public TableDataInfo list(@SpringQueryMap PayOrderDto payOrder);


    /**
     * 查询按照油品汇总的订单
     */
    @GetMapping("/station/order/selectOilPayOrderSum")
    public TableDataInfo selectOilPayOrderSum(PayOrderDto oilPayOrderSum);



    /**
     * 查询按照油品汇总的订单
     */
    @GetMapping("/station/order/selectOilPayOrderSumExport")
    public AjaxResult selectOilPayOrderSumExport(PayOrderDto oilPayOrderSum);


    /**
     * 查询订单的统计量
     */
    @GetMapping("/station/order/selectPayOrderSum")
    public AjaxResult selectPayOrderSum(PayOrderDto payOrder);


    @GetMapping("/station/order/updatePayOrderAmt")
    public AjaxResult updatePayOrderAmt(@RequestParam("startTime") String startTime,
                                        @RequestParam("endTime") String endTime,
                                        @RequestParam("discountAmount") BigDecimal discountAmount);



    /**
     * 批量删除订单
     *
     * @return
     */
    @DeleteMapping("/station/order/deletePay")
    public AjaxResult deletePay(@RequestBody List<Long> list);


    /**
     * 查询所有订单包括未支付的
     */
    @GetMapping("/station/order/allList")
    public TableDataInfo allList(PayOrderDto payOrder);


    /**
     * 查询所有订单包括未支付的
     */
    @GetMapping("/station/order/selectStatisticsPayOrderList")
    public TableDataInfo selectStatisticsPayOrderList(PayOrderDto payOrder);

    /**
     * 查询所有订单包括未支付的/station/order
     */
    @GetMapping("/station/order/selectStatisticsPayOrderSum")
    public AjaxResult selectStatisticsPayOrderSum(PayOrderDto payOrder);

    @GetMapping("/station/order/selectStatisticsPayOrderListExport")
    public AjaxResult selectStatisticsPayOrderListExport(PayOrderDto payOrder);

    /**
     * 关联用户查询订单支付列表
     */
    @GetMapping("/station/order/selectUserPayOrderList")
    public TableDataInfo selectUserPayOrderList(PayOrderDto payOrder);


    @GetMapping("/station/order/selectPayOrderList")
    public TableDataInfo selectPayOrderList(PayOrderDto payOrder);


    /**
     * 查询订单，通过appuser 信息
     */
    @GetMapping("/station/order/selectPayOrderByAppUserInfo")
    public TableDataInfo selectPayOrderByAppUserInfo(SysAppUserInfoDto sysAppUserInfo);

    /**
     * 查询订单支付列表
     */
    @GetMapping("/station/order/listInfo")
    public TableDataInfo listInfo(PayOrderDto payOrder);

    /**
     * 查询总金额，总升数
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectDaySources")
    public AjaxResult selectDaySources(PayOrderDto payOrder);


    /**
     * 查询总金额，总升数(针对加气平台的)
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectLNGDaySources")
    public AjaxResult selectLNGDaySources(PayOrderDto payOrder);

    /**
     * 查询总站下的合计数
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectAllDaySources")
    public AjaxResult selectAllDaySources(PayOrderDto payOrder) ;

    /**
     * 查询总站下的合计数
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectReceiveDaySources")
    public AjaxResult selectReceiveDaySources(PayOrderDto payOrder);

    /**
     * 首页以时间查询，实收和升数
     *
     * @param payOrder
     * @return
     */
    @PostMapping("/station/order/homeSumQuery")
    public AjaxResult homeSumQuery(@RequestBody PayOrderDto payOrder);

    /**
     * 查询总金额，总升数
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectSumPayOrder")
    public AjaxResult selectSumPayOrder(PayOrderDto payOrder);

    /***
     * 根据油品分类，查询油品的总金额，总升数
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectOilTypeSources")
    public TableDataInfo selectOilTypeSources(PayOrderDto payOrder);

    /***
     * 根据油品分类，查询油品的总金额，总升数，查询所有订单信息
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectAllOilTypeSources")
    public TableDataInfo selectAllOilTypeSources(PayOrderDto payOrder);


    /***
     * 根据油品分类，查询油品的总金额，总升数
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/dayOilTypeSources")
    public TableDataInfo dayOilTypeSources(PayOrderDto payOrder);

    /***
     * 根据油品分类，查询油品的总金额，总升数
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/dayAllOilTypeSources")
    public TableDataInfo dayAllOilTypeSources(PayOrderDto payOrder);
    /***
     * 根据油品分类，查询油品的总金额，总升数
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectOverViewData")
    public AjaxResult selectOverViewData(PayOrderDto payOrder);

    /***
     * 根据油品分类，查询油品的总金额，总升数(包括已经退款的)
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectAllOverViewData")
    public AjaxResult selectAllOverViewData(PayOrderDto payOrder);

    /**
     * 月报数据详细
     */
    @GetMapping("/station/order/selectDayReportDetail")
    public TableDataInfo selectDayReportDetail(PayOrderDto payOrder);

    /**
     * 月报数据详细
     */
    @GetMapping("/station/order/selectAllDayReportDetail")
    public TableDataInfo selectAllDayReportDetail(PayOrderDto payOrder);

    /***
     * 根据油品分类，查询油品的总金额，总升数
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/selectDayReport")
    public TableDataInfo selectDayReport(PayOrderDto payOrder);

    /**
     * 导出订单支付列表
     */
    @GetMapping("/station/order/export")
    public AjaxResult export(PayOrderDto payOrder);


    /**
     * 获取订单支付详细信息
     */
    @GetMapping(value = "/station/order/{orderId}")
    public AjaxResult getInfo(@PathVariable("orderId") Long orderId) ;


    /**
     * 根据上级集团的信息判断当前的用户是否进行审核
     */
    @PostMapping(value = "/station/order/applyExaminRefund")
    public AjaxResult applyExaminRefund(@RequestBody PayOrderDto payOrder);


    /**
     * 撤回申请
     */
    @PostMapping(value = "/station/order/recallApplyRefund")
    public AjaxResult recallApplyRefund(@RequestBody PayOrderDto payOrder);
    /**
     * 审核通过
     */
    @PostMapping("/station/order/examinRefundSuccess")
    public AjaxResult examinRefundSuccess(@RequestBody PayOrderDto payOrder,
                                          @RequestParam(value = "userId",required = false,defaultValue = "") Long userId);

    /**
     * 审核驳回
     */
    @PostMapping(value = "/station/order/examinRefundBack")
    public AjaxResult examinRefundBack(@RequestBody PayOrderDto payOrder);

    /**
     * 订单退款
     */
    @GetMapping(value = "/station/order/refund/{orderId}")
    public AjaxResult refund(@PathVariable("orderId") Long orderId);


    /**
     * 订单退款
     */
    @PostMapping(value = "/station/order/sxfRefund")
    public AjaxResult sxfRefund(@RequestBody PayOrderDto payOrder);


    /**
     * 恢复正常付款状态
     */
    @GetMapping(value = "/station/order/reback/{orderId}")
    public AjaxResult reback(@PathVariable("orderId") Long orderId);

    /**
     * 获取92号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata92")
    public TableDataInfo listQydata92(PayOrderDto payOrder);

    /**
     * 获取95号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata95")
    public TableDataInfo listQydata95(PayOrderDto payOrder);

    /**
     * 获取97号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata98")
    public TableDataInfo listQydata98(PayOrderDto payOrder);

    /**
     * 获取97号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata20")
    public TableDataInfo listQydata20(PayOrderDto payOrder);

    /**
     * 获取97号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata0")
    public TableDataInfo listQydata0(PayOrderDto payOrder);

    /**
     * 获取97号汽油数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listQydata10")
    public TableDataInfo listQydata10(PayOrderDto payOrder) ;

    /**
     * 获取x轴数据
     *
     * @param payOrder
     * @return
     */
    @GetMapping("/station/order/listXdata")
    public TableDataInfo listXdata(PayOrderDto payOrder);

    /**
     * 查询油站第一笔订单的数据
     */
    @GetMapping("/station/order/getPayOrderInfoMin")
    public AjaxResult getPayOrderInfoMin(PayOrderDto payOrder);

    /**
     * 新增订单支付
     */
    @PostMapping("/station/order")
    public AjaxResult add(@RequestBody PayOrderDto payOrder);

    /**
     * 修改订单支付
     */
    @PutMapping("/station/order")
    public AjaxResult edit(@RequestBody PayOrderDto payOrder);

    /**
     * 删除订单支付
     */
    @DeleteMapping("/station/order/{orderIds}")
    public AjaxResult remove(@PathVariable("orderIds") Long[] orderIds);

    /**
     * 查询订单支付列表
     */
    @GetMapping("/station/order/LNGDeptList")
    public TableDataInfo LNGDeptList(PayOrderDto payOrder);

    /**
     * 查询订单支付列表
     */
    @GetMapping("/station/order/LNGlist")
    public TableDataInfo LNGlist(PayOrderDto payOrder);

    @GetMapping("/station/order/LNGExport")
    public AjaxResult LNGExport(PayOrderDto payOrder);


    @GetMapping("/station/order/LNGDeptExport")
    public AjaxResult LNGDeptExport(PayOrderDto payOrder);


    /**
     * 补打订单信息
     */
    @GetMapping("/station/order/printOrderInfo")
    public AjaxResult printOrderInfo(PayOrderDto payOrder);


    /**
     * 补打订单信息
     */
    @GetMapping("/station/order/addPayOrder")
    public AjaxResult addPayOrder(PayOrderDto payOrder);

    @GetMapping("/station/order/selectOrderStatus")
    public AjaxResult selectOrderStatus(PayOrderDto payOrder);


    @GetMapping("/station/order/payOrderEmployee")
    public TableDataInfo payOrderEmployeePage(PayOrderEmployeeQueryForm payOrderEmployeeQueryForm);


    @GetMapping("/station/order/payOrderDetail")
    public TableDataInfo payOrderDetailPage(PayOrderDetailQueryForm payOrderDetailQueryForm);


    @GetMapping("/station/order/getInvoiceRecords")
    public List<InvoiceInfoVo> getInvoiceRecords(@RequestParam("OrderNo") String OrderNo);



    /**
     * 获取员工最后一次班结时间 和 员工标识
     * */
    @GetMapping("/station/order/employeePermission")
    public AjaxResult getEmployeePermission();


    @GetMapping("/station/order/newSelectStatisticsPayOrderList")
    public TableDataInfo newSelectStatisticsPayOrderList(@RequestParam(value = "oilName",required = false) String oilName,
                                                         @RequestParam(value = "payType",required = false) String payType,
                                                         @RequestParam(value = "districtIds",required = false) String districtIds ,
                                                         @RequestParam(value = "enterpriseId",required = false) Long enterpriseId,
                                                         @RequestParam(value = "stationId",required = false) Long stationId,
                                                         @RequestParam(value = "pageNum") Integer pageNum,
                                                         @RequestParam(value = "pageSize") Integer pageSize,
                                                         @RequestParam(value = "beginTime",required = false) String beginTime,
                                                         @RequestParam(value = "endTime",required = false) String endTime,
                                                         @RequestParam(value = "isDeleted",required = false) String isDeleted);


    @GetMapping("/station/order/newSelectStatisticsPayOrderSum")
    public AjaxResult newSelectStatisticsPayOrderSum(
                                        @RequestParam(value = "oilName",required = false) String oilName,
                                        @RequestParam(value = "payType",required = false) String payType,
                                        @RequestParam(value = "districtIds",required = false) String districtIds ,
                                        @RequestParam(value = "enterpriseId",required = false) Long enterpriseId,
                                        @RequestParam(value = "stationId",required = false) Long stationId,
                                        @RequestParam(value = "pageNum") Integer pageNum,
                                        @RequestParam(value = "pageSize") Integer pageSize,
                                        @RequestParam(value = "beginTime",required = false) String beginTime,
                                        @RequestParam(value = "endTime",required = false) String endTime,
                                        @RequestParam(value = "isDeleted",required = false) String isDeleted

    ) ;

    @GetMapping("/station/order/newSelectStatisticsPayOrderListExport")
    public AjaxResult newSelectStatisticsPayOrderListExport(
                                        @RequestParam(value = "oilName",required = false) String oilName,
                                        @RequestParam(value = "payType",required = false) String payType,
                                        @RequestParam(value = "districtIds",required = false) String districtIds ,
                                        @RequestParam(value = "enterpriseId",required = false) Long enterpriseId,
                                        @RequestParam(value = "stationId",required = false) Long stationId,
                                        @RequestParam(value = "pageNum") Integer pageNum,
                                        @RequestParam(value = "pageSize") Integer pageSize,
                                        @RequestParam(value = "beginTime",required = false) String beginTime,
                                        @RequestParam(value = "endTime",required = false) String endTime
    );


    @GetMapping("/station/order/getEnterpriseByDistrict")
    public AjaxResult getEnterpriseByDistrict(@RequestParam(value = "district", required = false) Integer district);


    @GetMapping("/station/order/getStationByEnterprise")
    public AjaxResult getStationByEnterprise(@RequestParam(value = "enterpriseId", required = false) Long enterpriseId);


}
